<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@page import="java.util.*" %>
<%
    int int_seg = ((ArrayList)request.getAttribute("arrL_segmento")).size() + 1;
    String str_w = String.valueOf((90/int_seg)) + "%";
%><head>
<title>
EPrice ~ Listado de Precio
</title>
</head>

<html:html>

<link href="css/estilos.css" rel="stylesheet" type="text/css" />
<script src="js/util.js" type="" language="javascript">
</script>
<script language="javascript" type="text/javascript">
function validaSearch(){
  try{
    if(document.getElementById("str_idGrupo").value.length == 0){
      alert('Seleccione un Grupo');
      return false;
    }
  }catch(e){
    alert(e);
  }finally{
  }
}

function enviar(){

}
</script>
<body bgcolor="#ffffff">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="52"><tiles:insert page="tiles/header.jsp"/></td>
  </tr>
  <tr>
    <td height="30"><tiles:insert page="tiles/menu.jsp"/></td>
  </tr>
  <tr>
    <td valign="top"><br/>
      <html:form action="/precioLista.do" method="get" onsubmit="validaSearch();">
        <html:hidden property="action" value="listarPrecioL"/>
        <table width="100%" border="0" cellpadding="0" cellspacing="1" class="tabla">
          <tr>
            <td colspan="<%=int_seg%>">
              <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="45%" height="18" align="right" class="encabezadoTabla font_general"><html:img width="17" height="23" src="images/img_loginFlecha.gif" alt=" "/></td>
                  <td width="55%" height="18" align="left" class="encabezadoTabla font_general">&nbsp;&nbsp;<strong>Precios</strong></td>
                </tr>
              </table>
            </td>
          </tr>
          <tr>
            <td colspan="<%=int_seg%>" valign="middle" class="colorLabel font_general">
              &nbsp;Grupo:
              <html:hidden property="str_idGrupo"/>
              <html:text property="str_descGrupo" styleClass="textfield" readonly="true"/>
              <html:link href="javascript:var win = centerPopUp('buscarGrupo.do?action=buscarGrupo', 'BuscarGrupo', 300, 300, 'YES' );"><html:img width="16" height="16" border="0" src="images/img_buscar.gif" alt="Buscar Grupo"/></html:link>
              <html:link href="javascript:var win = centerPopUp('precio_edit_upload.do', 'BuscarGrupo', 350, 150, 'YES' );"><html:img width="16" height="16" border="0" src="images/img_excel.gif" alt="Subir Lista de Precios en Excel"/></html:link>
            </td>
          </tr>
          <logic:notEmpty name="str_idGrupo">
          <tr>
            <td width="10%" height="50px" align="center" class="par font_general"><a href="javascript:var win = centerPopUp('precioListaEd.do?action=editarPrecioL&str_idGrupo=<bean:write name="str_idGrupo"/>', 'EditarP', 700, 210, 'YES' );"><img width="16" height="16" border="0" src="images/img_agregar.gif" alt="Agregar..." onClick=""></a></td>
            <logic:iterate id="segmento" name="arrL_segmento">
              <td align="left" width="<%=str_w%>" height="50px" valign="middle" bgcolor="#<bean:write name='segmento' property='str_codigoDiv'/>" class="font_general verticaltext">&nbsp;<bean:write name="segmento" property="str_descSeg"/></td>
            </logic:iterate>
          </tr>
		  <logic:present name="arrL_precios">
		  	<logic:iterate id="precio" name="arrL_precios">
				<tr>
            		<td align="center" class="par font_general">
						<a href="javascript:var winedti = centerPopUp('precioListaEd.do?action=editarPrecioL&str_idGrupo=<bean:write name='str_idGrupo'/>&str_rangoMin=<bean:write name='precio' property='dbl_rangoMin'/>&str_rangoMax=<bean:write name='precio' property='dbl_rangoMax'/>', 'EditarP', 700, 210, 'YES' );"><bean:write name="precio" property="str_rangoMin"/><logic:notEmpty name="precio" property="str_rangoMax"> - <bean:write name="precio" property="str_rangoMax"/></logic:notEmpty></a>
						<bean:define name="precio" property="arrL_precios" id="preccios_it"/>
						<logic:iterate id="precio_cant" name="preccios_it">
						<td align="center" class="par font_general">
							<bean:write name="precio_cant"/>
						</td>
						</logic:iterate>
					</td>
				</tr>
			</logic:iterate>
		  </logic:present>
          </logic:notEmpty>
        </table>
      </html:form>
    </td>
  </tr>
  <tr>
    <td height="39"><tiles:insert page="tiles/footer.jsp"/></td>
  </tr>
</table>
</body>
</html:html>
